Age-adjusted mean surface

plot_ly(showscale = FALSE) %>%
  add_surface(z=~mean_surface[,,2], x=~epoch_grid, y=~new_covariate,colors = "Greys" ) %>%
  layout(scene = list(
    xaxis = list(title = "Epoch"),
    yaxis = list(title = "Age (years)"),
    zaxis = list(title = "Normalized Delta Power"),
    camera = camera))

Age-adjusted eigenfunction

Age adjusted eigensurface

plot_ly(showscale = FALSE) %>%
  add_surface(z=~ -eigen_surface[,,2,1], x=~epoch_grid, y=~new_covariate, colors = "Greys") %>%
  layout(scene = list(
    xaxis = list(title = "Epoch"),
    yaxis = list(title = "Age (years)"),
    zaxis = list(title = "Normalized Delta Power"),
    camera = camera)) 

Age adjusted total variance

magnitude_tibble %>%
  ggplot(aes(x = covariate)) +
  geom_line(aes(y = mean)) +
  geom_ribbon(aes(ymin = lower, ymax = upper), alpha = .3) +
  labs(x = "Age", y = "Total variance") +
  theme_bw()

BMI adjusted mean surface

plot_ly(showscale = FALSE) %>%
  add_surface(z=~mean_surface[,,2], x=~epoch_grid, y=~new_covariate,colors = "Greys" ) %>%
  layout(scene = list(
    xaxis = list(title = "Epoch"),
    yaxis = list(title = "BMI"),
    zaxis = list(title = "Normalized Delta Power"),
    camera = camera))

BMI adjusted eigensurface

plot_ly(showscale = FALSE) %>%
  add_surface(z=~eigen_surface[,,2,1], x=~epoch_grid, y=~new_covariate, colors = "Greys") %>%
  layout(scene = list(
    xaxis = list(title = "Epoch"),
    yaxis = list(title = "BMI"),
    zaxis = list(title = "Normalized Delta Power"),
    camera = camera)) 

BMI adjusted total variance

magnitude_tibble %>%
  ggplot(aes(x = covariate)) +
  geom_line(aes(y = mean)) +
  geom_ribbon(aes(ymin = lower, ymax = upper), alpha = .3) +
  labs(x = "BMI", y = "Total variance") +
  theme_bw()

Systolic BP adjusted mean surface

plot_ly(showscale = FALSE) %>%
  add_surface(z=~mean_surface[,,2], x=~epoch_grid, y=~new_covariate,colors = "Greys" ) %>%
  layout(scene = list(
    xaxis = list(title = "Epoch"),
    yaxis = list(title = "Systolic BP"),
    zaxis = list(title = "Normalized Delta Power"),
    camera = camera))

Systolic BP adjusted eigensurface

plot_ly(showscale = FALSE) %>%
  add_surface(z=~ eigen_surface[,,2,1], x=~epoch_grid, y=~new_covariate, colors = "Greys") %>%
  layout(scene = list(
    xaxis = list(title = "Epoch"),
    yaxis = list(title = "Systolic BP"),
    zaxis = list(title = "Normalized Delta Power"),
    camera = camera)) 

Systolic BP adjusted total variance

magnitude_tibble %>%
  ggplot(aes(x = covariate)) +
  geom_line(aes(y = mean)) +
  geom_ribbon(aes(ymin = lower, ymax = upper), alpha = .3) +
  labs(x = "Systolic BP", y = "Total variance") +
  theme_bw()